<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
   <meta name="description" content="command line parsing">
    
    <meta name="author" content="John S. Urban" >
    <link rel="icon" href="../favicon.png">

    <title>demo_get_subcommand &ndash; M_CLI2</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/pygments.css" rel="stylesheet">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/local.css" rel="stylesheet">
    
    <link  href="../tipuesearch/tipuesearch.css" rel="stylesheet">
    
    

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script src="../js/jquery-2.1.3.min.js"></script>
    <script src="../js/svg-pan-zoom.min.js"></script>

  </head>

  <body>

    <!-- Fixed navbar -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="../index.html">M_CLI2 </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
        
            <li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
              <a href="#" class="dropdown-toggle"
              data-toggle="dropdown" role="button"
              aria-haspopup="true"
     aria-expanded="false">Contents <span class="caret"></span></a>
        <ul class="dropdown-menu">
          
              
            <li><a href="../lists/files.html">Source Files</a></li>
        
        
        
            <li><a href="../lists/modules.html">Modules</a></li>
        
            
                                
            <li><a href="../lists/procedures.html">Procedures</a></li>
        
               
            <li><a href="../lists/types.html">Derived Types</a></li>
        
        
            <li><a href="../lists/programs.html">Programs</a></li>
        
            </ul>
            </li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/files.html">Source Files</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/modules.html">Modules</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/procedures.html">Procedures</a></li>

                             
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/types.html">Derived Types</a></li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/programs.html">Programs</a></li>

          </ul>
        
        <form action="../search.html" class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
        </div>
<!--
        <button type="submit" class="btn btn-default">Submit</button>
-->
        </form>
        
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container">
    
  
  <div class="row">
    <h1>demo_get_subcommand
    <small>Program</small>
    
    </h1>
    
<div class="row">
  <div class="col-lg-12">
<div class="well well-sm">
  <ul class="list-inline" style="margin-bottom:0px;display:inline">
     
     
     
     
    
    
     <li><i class="fa fa-list-ol"></i>
       <a data-toggle="tooltip"
    data-placement="bottom" data-html="true"
    title=" 7.8% of total for programs.">50 statements</a>
     </li> 
     
     
     
    <li><i class="fa fa-code"></i><a href="../src/demo_get_subcommand.f90"> Source File</a></li>
     
     
  </ul>
  <ol class="breadcrumb in-well text-right">
  
    
     <li><a href='../sourcefile/demo_get_subcommand.f90.html'>demo_get_subcommand.f90</a></li>
    
  
     <li class="active">demo_get_subcommand</li>
  </ol>
</div>
</div>
</div>
<script>
  $(function () {
  $('[data-toggle="tooltip"]').tooltip()
  })
</script>

  </div>
  
  <div class="row">
    <div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
    
<div id="sidebar">
  
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-0">Variables</a></h3></div>
  <div id="vars-0" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-l~12">l</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-l_~5">l_</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-name~4">name</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-testname~2">testname</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-title~14">title</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-x~13">x</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-y~13">y</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-z~9">z</a>
      
    </div>
  </div>
</div>













<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#subs-0">Subroutines</a></h3></div>
  <div class="list-group">
    <div id="subs-0" class="panel-collapse collapse">
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#proc-parse~2">parse</a>
      
    </div>
  </div>
</div>









<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../program/demo_get_subcommand.html#src">demo_get_subcommand</a>
  </div>
</div>



</div>

    </div>
    
    <div class="col-md-9" id='text'>
    
  

    
    
    

     <section class="visible-xs visible-sm hidden-md">
       
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-1">Variables</a></h3></div>
  <div id="vars-1" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-l~12">l</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-l_~5">l_</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-name~4">name</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-testname~2">testname</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-title~14">title</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-x~13">x</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-y~13">y</a>
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#variable-z~9">z</a>
      
    </div>
  </div>
</div>













<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#subs-1">Subroutines</a></h3></div>
  <div class="list-group">
    <div id="subs-1" class="panel-collapse collapse">
      
      <a class="list-group-item" href="../program/demo_get_subcommand.html#proc-parse~2">parse</a>
      
    </div>
  </div>
</div>









<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../program/demo_get_subcommand.html#src">demo_get_subcommand</a>
  </div>
</div>



     </section>
     <br class="visible-xs visible-sm hidden-md">

     

    
    <section>
    <h2>Variables</h2>
    
<table class="table table-striped varlist">
<thead><tr><th>Type</th>

<th>Attributes</th><th></th><th>Name</th><th></th><th>Initial</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-l~12"></span>logical</td>
  
  
  <td></td><td>::</td>
  <td><strong>l</strong></td><td> =</td><td>.false.</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-l_~5"></span>logical</td>
  
  
  <td></td><td>::</td>
  <td><strong>l_</strong></td><td> =</td><td>.false.</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-name~4"></span>character(len=20)</td>
  
  
  <td></td><td>::</td>
  <td><strong>name</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-testname~2"></span>character(len=80)</td>
  
  
  <td></td><td>::</td>
  <td><strong>testname</strong></td><td> =</td><td>"not set"</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-title~14"></span>character(len=80)</td>
  
  
  <td></td><td>::</td>
  <td><strong>title</strong></td><td> =</td><td>"not set"</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-x~13"></span>real</td>
  
  
  <td></td><td>::</td>
  <td><strong>x</strong></td><td> =</td><td>-999.0</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-y~13"></span>real</td>
  
  
  <td></td><td>::</td>
  <td><strong>y</strong></td><td> =</td><td>-999.0</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-z~9"></span>real</td>
  
  
  <td></td><td>::</td>
  <td><strong>z</strong></td><td> =</td><td>-999.0</td><td></td>
  
</tr>

</tbody>
</table>

    </section>
    <br>
    
    
    
    
    
    
    

    
    
    


    
    <section>
    <h2>Subroutines</h2>
    
    
  <div class="panel panel-default">
  <div class="panel-heading codesum"><span class="anchor" id="proc-parse~2"></span><h3>
subroutine <a href='../proc/parse~2.html'>parse</a>(name)
    
    
   
</h3></div>
  <div class="panel-body">
       
    
    
    <h4>Arguments</h4>
    
      
      
<table class="table table-striped varlist">
<thead><tr><th>Type</th>
<th>Intent</th><th>Optional</th>
<th>Attributes</th><th></th><th>Name</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" ></span>character(len=*)</td>
  <td></td>
  <td></td>
  
  <td></td><td>::</td>
  <td><strong>name</strong></td><td></td>
  
</tr>

</tbody>
</table>

      
    
    

  </div>
  </div>

    
    </section>    
    
    
    
    <section>
    <h2 id="src">Source Code</h2>
    <div class="highlight"><pre><span></span>     <span class="k">program </span><span class="n">demo_get_subcommand</span>
     <span class="c">!x! SUBCOMMANDS</span>
     <span class="c">!x! For a command with subcommands like git(1)</span>
     <span class="c">!x! you can make separate namelists for each subcommand.</span>
     <span class="c">!x! You can call this program which has two subcommands (run, test),</span>
     <span class="c">!x! like this:</span>
     <span class="c">!x!    demo_get_subcommand --help</span>
     <span class="c">!x!    demo_get_subcommand run -x -y -z -title -l -L</span>
     <span class="c">!x!    demo_get_subcommand test -title -l -L -testname</span>
     <span class="c">!x!    demo_get_subcommand run --help</span>
        <span class="k">implicit none</span>
     <span class="c">!x! DEFINE VALUES TO USE AS ARGUMENTS WITH INITIAL VALUES</span>
        <span class="kt">real</span>               <span class="kd">::</span> <span class="n">x</span><span class="o">=-</span><span class="mi">99</span><span class="mf">9.0</span><span class="p">,</span><span class="n">y</span><span class="o">=-</span><span class="mi">99</span><span class="mf">9.0</span><span class="p">,</span><span class="n">z</span><span class="o">=-</span><span class="mi">99</span><span class="mf">9.0</span>
        <span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">title</span><span class="o">=</span><span class="s2">&quot;not set&quot;</span>
        <span class="kt">logical</span>            <span class="kd">::</span> <span class="n">l</span><span class="o">=</span><span class="p">.</span><span class="n">false</span><span class="p">.</span>
        <span class="kt">logical</span>            <span class="kd">::</span> <span class="n">l_</span><span class="o">=</span><span class="p">.</span><span class="n">false</span><span class="p">.</span>
        <span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">testname</span><span class="o">=</span><span class="s2">&quot;not set&quot;</span>
        <span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">20</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">name</span>
        <span class="k">call </span><span class="n">parse</span><span class="p">(</span><span class="n">name</span><span class="p">)</span> <span class="c">!x! DEFINE AND PARSE COMMAND LINE</span>
        <span class="c">!x! ALL DONE CRACKING THE COMMAND LINE.</span>
        <span class="c">!x! USE THE VALUES IN YOUR PROGRAM.</span>
        <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;command was &#39;</span><span class="p">,</span><span class="n">name</span>
        <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;x,y,z .... &#39;</span><span class="p">,</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">,</span><span class="n">z</span>
        <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;title .... &#39;</span><span class="p">,</span><span class="n">title</span>
        <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;l,l_ ..... &#39;</span><span class="p">,</span><span class="n">l</span><span class="p">,</span><span class="n">l_</span>
        <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;testname . &#39;</span><span class="p">,</span><span class="n">testname</span>
     <span class="k">contains</span>
<span class="k">     subroutine </span><span class="n">parse</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
     <span class="c">!x! PUT EVERYTHING TO DO WITH COMMAND PARSING HERE FOR CLARITY</span>
     <span class="k">use </span><span class="n">M_CLI2</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">set_args</span><span class="p">,</span> <span class="n">get_args</span><span class="p">,</span> <span class="n">get_args_fixed_length</span>
     <span class="k">use </span><span class="n">M_CLI2</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">get_subcommand</span>
     <span class="k">use </span><span class="n">M_CLI2</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">CLI_RESPONSE_FILE</span>
     <span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">)</span>              <span class="kd">::</span> <span class="n">name</span>    <span class="c">! the subcommand name</span>
     <span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="k">allocatable</span>  <span class="kd">::</span> <span class="n">help_text</span><span class="p">(:),</span> <span class="n">version_text</span><span class="p">(:)</span>
        <span class="n">CLI_RESPONSE_FILE</span><span class="o">=</span><span class="p">.</span><span class="n">true</span><span class="p">.</span>
     <span class="c">! define version text</span>
        <span class="n">version_text</span><span class="o">=</span><span class="p">[</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span> <span class="kd">::</span> <span class="p">&amp;</span>
           <span class="s1">&#39;@(#)PROGRAM:     demo_get_subcommand            &gt;&#39;</span><span class="p">,</span> <span class="p">&amp;</span>
           <span class="s1">&#39;@(#)DESCRIPTION: My demo program  &gt;&#39;</span><span class="p">,</span> <span class="p">&amp;</span>
           <span class="s1">&#39;@(#)VERSION:     1.0 20200715     &gt;&#39;</span><span class="p">,</span> <span class="p">&amp;</span>
           <span class="s1">&#39;@(#)AUTHOR:      me, myself, and I&gt;&#39;</span><span class="p">,</span> <span class="p">&amp;</span>
           <span class="s1">&#39;@(#)LICENSE:     Public Domain    &gt;&#39;</span><span class="p">,</span> <span class="p">&amp;</span>
           <span class="s1">&#39;&#39;</span> <span class="p">]</span>
         <span class="c">! general help for &quot;demo_get_subcommand --help&quot;</span>
         <span class="n">help_text</span><span class="o">=</span><span class="p">[</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span> <span class="kd">::</span> <span class="p">&amp;</span>
          <span class="s1">&#39; allowed subcommands are          &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;   * run  -l -L -title -x -y -z   &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;   * test -l -L -title            &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;&#39;</span> <span class="p">]</span>
        <span class="c">! find the subcommand name by looking for first word on command</span>
        <span class="c">! not starting with dash</span>
        <span class="n">name</span> <span class="o">=</span> <span class="n">get_subcommand</span><span class="p">()</span>
        <span class="k">select case</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
        <span class="k">case</span><span class="p">(</span><span class="s1">&#39;run&#39;</span><span class="p">)</span>
         <span class="n">help_text</span><span class="o">=</span><span class="p">[</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span> <span class="kd">::</span> <span class="p">&amp;</span>
          <span class="s1">&#39;                                  &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39; Help for subcommand &quot;run&quot;        &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;                                  &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;&#39;</span> <span class="p">]</span>
         <span class="k">call </span><span class="n">set_args</span><span class="p">(</span> <span class="p">&amp;</span>
         <span class="p">&amp;</span> <span class="s1">&#39;-x 1 -y 2 -z 3 --title &quot;my title&quot; -l F -L F&#39;</span><span class="p">,&amp;</span>
         <span class="p">&amp;</span> <span class="n">help_text</span><span class="p">,</span><span class="n">version_text</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span><span class="n">x</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;y&#39;</span><span class="p">,</span><span class="n">y</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="n">z</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args_fixed_length</span><span class="p">(</span><span class="s1">&#39;title&#39;</span><span class="p">,</span><span class="n">title</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="n">l</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="n">l_</span><span class="p">)</span>
        <span class="k">case</span><span class="p">(</span><span class="s1">&#39;test&#39;</span><span class="p">)</span>
         <span class="n">help_text</span><span class="o">=</span><span class="p">[</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span> <span class="kd">::</span> <span class="p">&amp;</span>
          <span class="s1">&#39;                                  &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39; Help for subcommand &quot;test&quot;       &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;                                  &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
          <span class="s1">&#39;&#39;</span> <span class="p">]</span>
         <span class="k">call </span><span class="n">set_args</span><span class="p">(&amp;</span>
         <span class="p">&amp;</span> <span class="s1">&#39;--title &quot;my title&quot; -l F -L F --testname &quot;Test&quot;&#39;</span><span class="p">,&amp;</span>
         <span class="p">&amp;</span> <span class="n">help_text</span><span class="p">,</span><span class="n">version_text</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args_fixed_length</span><span class="p">(</span><span class="s1">&#39;title&#39;</span><span class="p">,</span><span class="n">title</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="n">l</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args</span><span class="p">(</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="n">l_</span><span class="p">)</span>
         <span class="k">call </span><span class="n">get_args_fixed_length</span><span class="p">(</span><span class="s1">&#39;testname&#39;</span><span class="p">,</span><span class="n">testname</span><span class="p">)</span>
        <span class="k">case </span><span class="n">default</span>
         <span class="c">! process help and version</span>
         <span class="k">call </span><span class="n">set_args</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">,</span><span class="n">help_text</span><span class="p">,</span><span class="n">version_text</span><span class="p">)</span>
         <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="s1">&#39;(*(a))&#39;</span><span class="p">)</span><span class="s1">&#39;unknown or missing subcommand [&#39;</span><span class="p">,</span><span class="nb">trim</span><span class="p">(</span><span class="n">name</span><span class="p">),</span><span class="s1">&#39;]&#39;</span>
         <span class="k">write</span><span class="p">(</span><span class="o">*</span><span class="p">,</span><span class="s1">&#39;(a)&#39;</span><span class="p">)[</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">80</span><span class="p">)</span> <span class="kd">::</span>  <span class="p">&amp;</span>
         <span class="s1">&#39; allowed subcommands are          &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
         <span class="s1">&#39;   * run  -l -L -title -x -y -z   &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
         <span class="s1">&#39;   * test -l -L -title            &#39;</span><span class="p">,</span> <span class="p">&amp;</span>
         <span class="s1">&#39;&#39;</span> <span class="p">]</span>
         <span class="k">stop</span>
<span class="k">        end select</span>
<span class="k">     end subroutine </span><span class="n">parse</span>
     <span class="k">end program </span><span class="n">demo_get_subcommand</span>
</pre></div>

    </section>
    
    
    </div>
  </div>

  
    <hr>    
    </div> <!-- /container -->
    <footer>
      <div class="container">
      <div class="row">
        <div class="col-xs-6 col-md-4"><p>&copy; 2022 
                                          </p></div>
        <div class="col-xs-6 col-md-4 col-md-push-4">
          <p class="text-right">
            Documentation generated by 
            <a href="https://github.com/cmacmackin/ford">FORD</a>
             on 2022-06-08 21:13  
          </p>
        </div>
        <div class="col-xs-12 col-md-4 col-md-pull-4"><p class="text-center"> M_CLI2 was developed by John S. Urban</p></div>
      </div>
      <br>
      </div> <!-- /container -->    
    </footer>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
    <script src="../js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../js/ie10-viewport-bug-workaround.js"></script>

    <!-- MathJax JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
        jax: ['input/TeX','input/MathML','output/HTML-CSS'],
        extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
      });
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    
    <script src="../tipuesearch/tipuesearch_content.js"></script>
    <script src="../tipuesearch/tipuesearch_set.js"></script>
    <script src="../tipuesearch/tipuesearch.js"></script>
    
    
  </body>
</html>